﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DPS.Prototype.Provider.Interface;
using DPS.Prototype.Model;
using DPS.DataModel;
using System.Configuration;
using DPS.Prototype.Model.Adapter;

namespace DPS.Prototype.Provider
{
    public class HoldingModelsProvider : IHoldingModelsProvider
    {
        public List<HoldingModels> GetAllHoldingModels()
        {
            DPSDataModelDataContext dataContext = DataContextProvider.DataContext;
            List<DPSHoldingModel> models = dataContext.DPSHoldingModels.Where(m => m.IsActive == 1).ToList();
            List<HoldingModels> modelList = new List<HoldingModels>();
            models.ForEach(m =>
            {
                modelList.Add(HoldingModelAdapter.Adapter(m));
            });
            return modelList;
        }
    }
}
